package com.iqiyi.pps.epg.core.dao.ticket;

import com.iqiyi.pps.epg.api.model.web.ticket.TTicketSysConfig;
import com.iqiyi.pps.epg.core.dao.base.BaseDao;
import com.iqiyi.pps.epg.core.model.ticket.TicketSysConfig;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;

@Component
public class TicketSysConfigDao extends BaseDao<TicketSysConfig> {
    public TTicketSysConfig transToThrift(TicketSysConfig tempData) {
        TTicketSysConfig entity = new TTicketSysConfig();
        entity.setId(tempData.getId());
        entity.setId(tempData.getId());
        entity.setKey(tempData.getKey());
        entity.setVal(tempData.getVal());
        entity.setDesc(tempData.getDescr());
        entity.setType(tempData.getType());
        entity.setStatus(tempData.getStatus());
        return entity;
    }

    public List<TTicketSysConfig> transToTList(List<TicketSysConfig> dataList) {
        List<TTicketSysConfig> resultList = new ArrayList<>();
        TTicketSysConfig entity = null;
        for (TicketSysConfig tempData : dataList) {
            entity = transToThrift(tempData);
            resultList.add(entity);
        }
        return resultList;
    }
}
